	function submitF(){
		var result = window.confirm('确定提交吗？');
		return result;
	}
//编辑店铺信息
$('.agentListEditShopInfo').on('click',function(){
	var name = $(this).parent().parent().find('.name').html();
	var phone = $(this).parent().parent().find('.phone').html();
	var qq = $(this).parent().parent().find('.qq').html();
	var wangwang = $(this).parent().parent().find('.wangwang').html();
	$('.modelBg').show();
	$('#shopInfoUserName').val(name);
	$('#shopInfoUserPhone').val(phone);
	$('#shopInfoUserQQ').val(qq);
	$('#shopInfoUserWx').val(wangwang);
	$('.agentListShopInfoBox').show().attr('id',$(this).parent().parent().attr('id'));
	$('html,body').css('overflow','hidden');
})
//取消浮层
$('.agentListShopInfoBoxBtnCancel').on('click',function(){
	$('.modelBg').hide();
	$('.agentListShopInfoBox').hide();
	$('html,body').css('overflow-y','scroll');
})
//提交数据
$('.agentListShopInfoBoxBtnSubmit').on('click',function(){
	alert(111111111111);
	$.ajax({
		url:'/eshop/backEshop/editAgent.json',
		dataType:'JSON',
		type:'POST',
		data:{
			'agentId':$('.agentListShopInfoBox').attr('id'),
			'name':$('#shopInfoUserName').val(),
			'phone':$('#shopInfoUserPhone').val(),
			'qq':$('#shopInfoUserQQ').val(),
			'weixin':$('#shopInfoUserWx').val()
		},
		success:function(res){
			alert(res);
			if(res['code'] == 200){
				window.history.go(0);
			}else if(res['code'] == -200){
				alert(res['message']);
			}
		}
	})
})
//删除数据
$('.agentListDeleteShopInfo').on('click',function(){
	if(confirm('确定删除这条信息吗？')){
		var _this = this;
		$.ajax({
			url:'/eshop/backEshop/deleteAgent.json',
			dataType:'JSON',
			type:'POST',
			data:{
				'agentId':$(_this).parent().parent().attr('id')
			},
			success:function(res){
				console.log(res);
				if(res['code'] == 200){
					window.history.go(0);
				}else if(res['code'] == -200){
					alert(res['message']);
				}
				
			}
		})
	}
})

//搜索代理商
$('.searchAgentBtn').on('click',function(){
	var wangwang = $('#searchWangwang').val();
	var name = $('#searchName').val();
	var phone = $('#searchPhone').val();
	var qq = $('#searchQq').val();
	window.location.href = "/eshop/backEshop/agentList.htm?name="+name+"&phone="+phone+"&qq="+qq+"&wangwang="+wangwang;
})
//分页
//var tableHeight=$(".littleCr").height();
//alert(tableHeight);
//$(".littleCl").height(tableHeight);
//$(".littleCc").height(tableHeight);
 var pageCount=$(".pageCount").val();
    $(".tcdPageCode").createPage({
        pageCount:pageCount,
        current:$('.pageNo').val(),
        backFn:function(p){
//            var companyNameVar = $(".companyName").val();
//			if(companyNameVar!=null){
//				companyNameVar = encodeURI(encodeURI(companyNameVar));
//			}
        	window.location.href="/eshop/backEshop/agentList.htm?pageNo="+p;
        }
    });